import Vue from 'vue'
import VueRouter from 'vue-router'
import Chat from '@/views/Chat'
import Profile from '@/views/Profile'
import Article from '@/views/Article'
import Layout from '@/views/Layout'
import Home from '@/views/Home'
import Question from '@/views/Question'
import Video from '@/views/Video'
import User from '@/views/User'
import Login from '@/views/login/index'

Vue.use(VueRouter)

const routes = [
  {
    path: '/article',
    component: Article
  },
  {
    path: '/',
    component: Layout,
    children: [{
      path: '/home',
      component: Home
    }, {
      path: '/question',
      component: Question
    }, {
      path: '/video',
      component: Video
    }, {
      path: '/user',
      component: User,
      children: [{
        path: '/profile',
        component: Profile
      }, {
        path: '/chat',
        component: Chat
      }]
    }]
  },
  {
    path: '/login',
    component: Login
  }
]

const router = new VueRouter({
  routes
})

export default router
